import service from '@/utils/request'

// @Tags TProduct
// @Summary 创建tProduct表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.TProduct true "创建tProduct表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /tProduct/createTProduct [post]
export const createTProduct = (data) => {
  return service({
    url: '/tProduct/createTProduct',
    method: 'post',
    data
  })
}

// @Tags TProduct
// @Summary 删除tProduct表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.TProduct true "删除tProduct表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /tProduct/deleteTProduct [delete]
export const deleteTProduct = (data) => {
  return service({
    url: '/tProduct/deleteTProduct',
    method: 'delete',
    data
  })
}

// @Tags TProduct
// @Summary 批量删除tProduct表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除tProduct表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /tProduct/deleteTProduct [delete]
export const deleteTProductByIds = (data) => {
  return service({
    url: '/tProduct/deleteTProductByIds',
    method: 'delete',
    data
  })
}

// @Tags TProduct
// @Summary 更新tProduct表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.TProduct true "更新tProduct表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /tProduct/updateTProduct [put]
export const updateTProduct = (data) => {
  return service({
    url: '/tProduct/updateTProduct',
    method: 'put',
    data
  })
}

// @Tags TProduct
// @Summary 用id查询tProduct表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.TProduct true "用id查询tProduct表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /tProduct/findTProduct [get]
export const findTProduct = (params) => {
  return service({
    url: '/tProduct/findTProduct',
    method: 'get',
    params
  })
}

// @Tags TProduct
// @Summary 分页获取tProduct表列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取tProduct表列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /tProduct/getTProductList [get]
export const getTProductList = (params) => {
  return service({
    url: '/tProduct/getTProductList',
    method: 'get',
    params
  })
}

export const getTProductListByProductName = (productName) => {
  return service({
    url: '/tProduct/getTProductList',
    method: 'get',
    params:{
      "productName":productName
    }
  })
}

export const getTProductListByIds = (data) => {
  return service({
    url: '/tProduct/getTProductListByIds',
    method: 'post',
    data
  })
}
